package com.xpqh.ksg.common.persistence.dao;

import com.xpqh.ksg.common.persistence.model.KsgProductPeriphery;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xpqh.ksg.modular.periphery.dto.KsgProductPeripheryDetailsRespDTO;
import com.xpqh.ksg.modular.periphery.dto.KsgProductPeripheryListDTO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2025-04-16
 */
public interface KsgProductPeripheryMapper extends BaseMapper<KsgProductPeriphery> {

    List<KsgProductPeripheryListDTO> getProductPeripheryList(@Param("searchContent") String searchContent,@Param("order") String order, @Param("label") String label, @Param("pageNo") Integer pageNo, @Param("pageSize")Integer pageSize);

    KsgProductPeripheryDetailsRespDTO getProductPeripheryDetails(@Param("autoId") String autoId);

    @Update("update ksg_product_periphery set like_num = ifnull(like_num, 0) + 1 where id = #{autoId}")
    void doLike(@Param("autoId") String autoId);
}

